package com.cskaoyan.controller;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.YJCDashboardVO;
import com.cskaoyan.service.HomeService_yjc;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin")
public class YJCDashboardController {
    @Autowired
    HomeService_yjc homeService_yjc;


    @RequestMapping("dashboard")
    public BaseRespVo<YJCDashboardVO> dashboard() {

        int i1 = homeService_yjc.countGoods();
        int i2 = homeService_yjc.countUsers();
        int i3 = homeService_yjc.countProducts();
        int i4 = homeService_yjc.countOrders();
        YJCDashboardVO yjcDashboardVO = new YJCDashboardVO(i1, i2, i3, i4);

        return BaseRespVo.ok(yjcDashboardVO);
    }
}
